package com.lcredu.homework.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @author 黎长容
 * @date 2025-07-17 23:54
 */
@Repository
public class BuyerDao {
    @Resource
    private JdbcTemplate jdbcTemplate;

    //购买者扣费
    public void updateMoney(Integer buyerId, Float money) {
        String sql = "update buyer set money = money - ? where id = ?";
        jdbcTemplate.update(sql, money, buyerId);
    }


}
